package com.it.xyx;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;

/**
 * @Classname MyRequestOriginParser  授权实现类
 * @Description TODO
 * @Date 2024/8/22 18:47
 * @Created by 潜伏Sir
 */
@Component
public class MyRequestOriginParser implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        // 从请求参数中获取名为 origin 的参数并返回
        return httpServletRequest.getParameter("serverName");
    }
}
